package com.xiaoke.api.service;

import com.xiaoke.entity.Comment;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.ws.rs.GET;
import java.util.List;
import java.util.Map;

@FeignClient("service")
public interface CommentService {

    @PostMapping("/comment/insert")
    void insert(@RequestBody Comment comment,@RequestParam("images") String images);

    @GetMapping("/comment/countByGoods")
    Integer countByGoods(@RequestParam("goodsId") String goodsId);

    @GetMapping("/comment/findByGoodsAndPic")
    List<Map<String,Object>> findByGoodsAndPic(@RequestParam("goodsId") String goodsId,@RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize") Integer pageSize,@RequestParam("showType") Integer showType);

    @GetMapping("/comment/countByGoodsPic")
    Integer countByGoodsPic(@RequestParam("goodsId") String goodsId);

}
